﻿@using MvcApplication.Entity
@{
    Layout = "~/Views/Shared/_Public.cshtml";
    ViewBag.Title = SiteInfoSession.SiteInfo.Name;
}

@section style{
    <script src="~/Content/themes/default/js/mian.js"></script>
}
<div ms-controller="main" class="column">
    <div class="index_posts col-3-2">
        <ul>
            <li class="column post_block" ms-repeat="posts">
                <div class="col-4-1">
                    <img ms-if="el.FirstPicture==null" ms-attr-src="" class="first_picture" />
                    <img ms-if="el.FirstPicture!=null" ms-attr-src="'/image?path='+el.FirstPicture" class="first_picture" />
                </div>
                <div class="col-4-3 last">
                    <div class="index_main_info">
                        <h2 class="index_title">
                            <a ms-attr-href="'post_'+el.ID">{{el.Title}}</a>
                        </h2>
                        <div class="index_info">
                            <a ms-repeat-category="el.Categories" class="index_label" ms-attr-href="'/category_'+category.ID">{{category.Name}}
                            </a>
                            <span ms-if="el.Categories && el.Categories.length">|</span>
                            <span>{{el.LastModifyAt | date("yyyy年MM月dd")}}</span>
                        </div>
                        <p>
                            {{el.Detail | not_html}}
                        </p>
                    </div>
                </div>
            </li>
        </ul>
        <a href="###" ms-if="page_index < pages" ms-click="get_posts()">下一页</a>
        <a href="###" ms-if="page_index>=pages">加载完了</a>
    </div>
    <div class="col-3-1 last">
        <h2>顶置</h2>
        <div ms-repeat="top_posts"><a ms-attr-href="'/post_'+el.ID">{{el.Title}}</a></div>
        <h2>热门</h2>
        <div ms-repeat="hot_posts"><a ms-attr-href="'/post_'+el.ID">{{el.Title}}</a></div>
        <h2>推荐</h2>
        <div ms-repeat="recommended_posts"><a ms-attr-href="'/post_'+el.ID">{{el.Title}}</a></div>
    </div>
</div>
